import { ref, onMounted, onUnmounted } from "vue";

export function useResize() {
    let w = ref(innerWidth - 100 - 10);

    onMounted(() => {
        window.onresize = function () {
            w.value = innerWidth - 100 - 10;
            if (w.value <= 340) {
                w.value = 340;
            }
        };
    });
    onUnmounted(() => {
        window.onresize = null;
    })

    return {
        w,
    }
}
